/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bash.carrep.dao.enties;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author p.bashizi
 */
@Entity
@Table(name = "categoriepm", catalog = "carrepdb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Categoriepm.findAll", query = "SELECT c FROM Categoriepm c"),
    @NamedQuery(name = "Categoriepm.findByIdCategoriePM", query = "SELECT c FROM Categoriepm c WHERE c.idCategoriePM = :idCategoriePM"),
    @NamedQuery(name = "Categoriepm.findByDescription", query = "SELECT c FROM Categoriepm c WHERE c.description = :description"),
    @NamedQuery(name = "Categoriepm.findByTauxExoneration", query = "SELECT c FROM Categoriepm c WHERE c.tauxExoneration = :tauxExoneration")})
public class Categoriepm implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idCategoriePM", nullable = false)
    private Integer idCategoriePM;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "Description", nullable = false, length = 45)
    private String description;
    @Basic(optional = false)
    @NotNull
    @Column(name = "TauxExoneration", nullable = false)
    private double tauxExoneration;

    public Categoriepm() {
    }

    public Categoriepm(Integer idCategoriePM) {
        this.idCategoriePM = idCategoriePM;
    }

    public Categoriepm(Integer idCategoriePM, String description, double tauxExoneration) {
        this.idCategoriePM = idCategoriePM;
        this.description = description;
        this.tauxExoneration = tauxExoneration;
    }

    public Integer getIdCategoriePM() {
        return idCategoriePM;
    }

    public void setIdCategoriePM(Integer idCategoriePM) {
        this.idCategoriePM = idCategoriePM;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public double getTauxExoneration() {
        return tauxExoneration;
    }

    public void setTauxExoneration(double tauxExoneration) {
        this.tauxExoneration = tauxExoneration;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCategoriePM != null ? idCategoriePM.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Categoriepm)) {
            return false;
        }
        Categoriepm other = (Categoriepm) object;
        if ((this.idCategoriePM == null && other.idCategoriePM != null) || (this.idCategoriePM != null && !this.idCategoriePM.equals(other.idCategoriePM))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bash.carrep.dao.enties.Categoriepm[ idCategoriePM=" + idCategoriePM + " ]";
    }
    
}
